package c.c.a;

import org.json.JSONObject;

public abstract class b2 {
    public boolean a;
    public boolean b;
    public boolean c;
    public boolean d;

    public b2(boolean z, boolean z2) {
        this.b = z;
        this.c = z2;
        this.d = false;
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:34:0x008d */
    /* JADX WARNING: Missing exception handler attribute for start block: B:25:0x0078 */
    /* JADX WARNING: Removed duplicated region for block: B:65:0x00d0 A:{SYNTHETIC, Splitter:B:65:0x00d0} */
    /* JADX WARNING: Removed duplicated region for block: B:69:0x00d7 A:{SYNTHETIC, Splitter:B:69:0x00d7} */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x00a5 A:{Catch:{ all -> 0x00ca }} */
    /* JADX WARNING: Removed duplicated region for block: B:54:0x00bf A:{SYNTHETIC, Splitter:B:54:0x00bf} */
    /* JADX WARNING: Removed duplicated region for block: B:58:0x00c6 A:{SYNTHETIC, Splitter:B:58:0x00c6} */
    /* JADX WARNING: Removed duplicated region for block: B:65:0x00d0 A:{SYNTHETIC, Splitter:B:65:0x00d0} */
    /* JADX WARNING: Removed duplicated region for block: B:69:0x00d7 A:{SYNTHETIC, Splitter:B:69:0x00d7} */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Can't wrap try/catch for region: R(10:11|12|13|(4:15|16|17|(2:20|(4:(2:23|24)|25|26|27)))|29|30|(2:32|33)|34|35|36) */
    /* JADX WARNING: Can't wrap try/catch for region: R(4:(2:23|24)|25|26|27) */
    public java.lang.String a(java.lang.String r8, java.lang.String r9) {
        /*
        r7 = this;
        r0 = android.os.Environment.getExternalStorageState();
        r1 = "mounted";
        r0 = r1.equals(r0);
        if (r0 != 0) goto L_0x000d;
    L_0x000c:
        return r9;
    L_0x000d:
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = android.os.Environment.getExternalStorageDirectory();
        r1 = r1.getPath();
        r0.append(r1);
        r1 = "/Android/data/com.snssdk.api.embed/cache";
        r0.append(r1);
        r0 = r0.toString();
        r1 = "/";
        r8 = c.b.a.a.a.E(r0, r1, r8);
        r1 = 0;
        r2 = new java.io.File;	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        r2.<init>(r0);	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        r0 = r2.exists();	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        if (r0 != 0) goto L_0x003f;
    L_0x0038:
        r0 = r2.mkdirs();	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        if (r0 != 0) goto L_0x003f;
    L_0x003e:
        return r9;
    L_0x003f:
        r0 = new java.io.File;	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        r0.<init>(r8);	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        r8 = new java.io.RandomAccessFile;	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        r2 = "rwd";
        r8.<init>(r0, r2);	 Catch:{ IOException -> 0x009c, all -> 0x0098 }
        r2 = r8.getChannel();	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r1 = r2.lock();	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r0 = r0.isFile();	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r2 = "UTF-8";
        if (r0 == 0) goto L_0x007c;
    L_0x005b:
        r0 = 129; // 0x81 float:1.81E-43 double:6.37E-322;
        r3 = new byte[r0];	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r4 = 0;
        r5 = r8.read(r3, r4, r0);	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        if (r5 <= 0) goto L_0x007c;
    L_0x0066:
        if (r5 >= r0) goto L_0x007c;
    L_0x0068:
        r0 = new java.lang.String;	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r0.<init>(r3, r4, r5, r2);	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r3 = c.c.a.c.g(r0);	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        if (r3 == 0) goto L_0x007c;
    L_0x0073:
        if (r1 == 0) goto L_0x0078;
    L_0x0075:
        r1.release();	 Catch:{ Exception -> 0x0078 }
    L_0x0078:
        r8.close();	 Catch:{ Exception -> 0x007b }
    L_0x007b:
        return r0;
    L_0x007c:
        r0 = r9.getBytes(r2);	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r2 = 0;
        r8.setLength(r2);	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        r8.write(r0);	 Catch:{ IOException -> 0x0093, all -> 0x0091 }
        if (r1 == 0) goto L_0x008d;
    L_0x008a:
        r1.release();	 Catch:{ Exception -> 0x008d }
    L_0x008d:
        r8.close();	 Catch:{ Exception -> 0x0090 }
    L_0x0090:
        return r9;
    L_0x0091:
        r9 = move-exception;
        goto L_0x00ce;
    L_0x0093:
        r0 = move-exception;
        r6 = r1;
        r1 = r8;
        r8 = r6;
        goto L_0x009f;
    L_0x0098:
        r8 = move-exception;
        r9 = r8;
        r8 = r1;
        goto L_0x00ce;
    L_0x009c:
        r8 = move-exception;
        r0 = r8;
        r8 = r1;
    L_0x009f:
        r2 = android.os.Build.VERSION.SDK_INT;	 Catch:{ all -> 0x00ca }
        r3 = 23;
        if (r2 < r3) goto L_0x00bd;
    L_0x00a5:
        r2 = c.c.a.s1.b();	 Catch:{ all -> 0x00ca }
        r2 = r2.c;	 Catch:{ all -> 0x00ca }
        r3 = "android.permission.READ_EXTERNAL_STORAGE";
        r2 = r2.checkSelfPermission(r3);	 Catch:{ all -> 0x00ca }
        if (r2 != 0) goto L_0x00b7;
    L_0x00b3:
        c.c.a.m0.b(r0);	 Catch:{ all -> 0x00ca }
        goto L_0x00bd;
    L_0x00b7:
        r9 = new java.lang.SecurityException;	 Catch:{ all -> 0x00ca }
        r9.<init>(r0);	 Catch:{ all -> 0x00ca }
        throw r9;	 Catch:{ all -> 0x00ca }
    L_0x00bd:
        if (r8 == 0) goto L_0x00c4;
    L_0x00bf:
        r8.release();	 Catch:{ Exception -> 0x00c3 }
        goto L_0x00c4;
    L_0x00c4:
        if (r1 == 0) goto L_0x00c9;
    L_0x00c6:
        r1.close();	 Catch:{ Exception -> 0x00c9 }
    L_0x00c9:
        return r9;
    L_0x00ca:
        r9 = move-exception;
        r6 = r1;
        r1 = r8;
        r8 = r6;
    L_0x00ce:
        if (r1 == 0) goto L_0x00d5;
    L_0x00d0:
        r1.release();	 Catch:{ Exception -> 0x00d4 }
        goto L_0x00d5;
    L_0x00d5:
        if (r8 == 0) goto L_0x00da;
    L_0x00d7:
        r8.close();	 Catch:{ Exception -> 0x00da }
    L_0x00da:
        throw r9;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.a.b2.a(java.lang.String, java.lang.String):java.lang.String");
    }

    public abstract boolean b(JSONObject jSONObject);

    public b2(boolean z, boolean z2, boolean z3) {
        this.b = z;
        this.c = z2;
        this.d = z3;
    }
}
